function handles = renameCell(handles)
% renameCell
%
% Editing:
% gs may 2005
% -----------------------------------------------


% prompt user for new name
newName = inputdlg('New name:');
% newName = newName{1};
newName = newName(1);

% determine which cell was selected
cellVal = get(handles.cellList, 'Value');

% determine which group is also selected
groupVal = get(handles.groupList, 'Value');

% rename as needed in the handles structure
listsAndExpts = handles.analysis.mapAverager.cellLists.currentFile.listsAndExpts;

newList = listsAndExpts(groupVal, 2);
newList{1}(cellVal) = newName;
listsAndExpts(groupVal, 2) = newList;

handles.analysis.mapAverager.cellLists.currentFile.listsAndExpts = listsAndExpts;

% update the listboxes
set(handles.cellList, 'String', newList{1}(:));

% save
handles = saveListFile(handles);

